package com.xomily.system.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xomily.common.annotation.Excel;
import com.xomily.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;


/**
 * 留言对象 sys_message
 *
 * @author ruoyi
 * @date 2025-04-05
 */
public class SysMessage extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键，自增
     */
    private Long id;

    /**
     * 外键，关联用户表
     */
    @Excel(name = "外键，关联用户表")
    private Long userId;
    private String userName;

    /**
     * 留言内容
     */
    @Excel(name = "留言内容")
    private String content;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date createdAt;

    /**
     * 留言状态（如未处理、已处理）
     */
    @Excel(name = "留言状态", readConverterExp = "如=未处理、已处理")
    private String status;

    public void setId(Long id) {
        this.id = id;
    }

    public Long getId() {
        return id;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public Long getUserId() {
        return userId;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getContent() {
        return content;
    }

    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt() {
        return createdAt;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getStatus() {
        return status;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("id", getId())
                .append("userId", getUserId())
                .append("content", getContent())
                .append("createdAt", getCreatedAt())
                .append("status", getStatus())
                .toString();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}
